#!/bin/sh

DIALOG="/opt/QtDialog/bin/QtDialog"
TITLE="Power control"


OP=`echo -e "<br/><center><h1>Restart</h1></center><br/>\n<br/><center><h1>Shutdown</h1></center><br/>\n<br/><center><h1>Cancel</h1></center><br/>" | $DIALOG --title "$TITLE" --listbox ""`
if  [ "$?" != "0" -o "$OP" == "" ]; then
	echo "cancelled"
else
    case "$OP" in
	*Restart*)
	    /sbin/reboot
	    ;;
	*Shutdown*)
	    /sbin/poweroff
	    ;;
    esac
fi
